#!/usr/bin/env python
from astropy.io import fits
from glob import glob
import numpy as np

nums = len(glob("T1_1_*.fits"))
for i in range(nums):
    result_im = np.zeros((10000,12000))
    result_im[0:5000,:6000] = fits.getdata("T1_1_"+str(i+1)+".fits")
    result_im[0:5000,6000:] = fits.getdata("T1_2_"+str(i+1)+".fits")
    result_im[5000:,:6000] = fits.getdata("T1_3_"+str(i+1)+".fits")
    result_im[5000:,6000:] = fits.getdata("T1_4_"+str(i+1)+".fits")
    fits.writeto("bias-"+str(i+1)+".fits",data=result_im)
